package day3;

import day2.pet.Dog;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class ColTest2 {
    public static void main(String[] args) {
        List<Dog> list = new ArrayList<>();
        list.add(new Dog("大黄", "公", 88, 77));
        list.add(new Dog("小花花", "公", 64, 88));
        list.add(new Dog("小泉", "公", 23, 42));
        list.add(new Dog("Mary", "母", 45, 72));
        list.add(new Dog("贾斯汀", "公", 66, 99));
        list.add(new Dog("比伯", "公", 44, 48));
        System.out.println("默认是按照love来排序：");
        Collections.sort(list);
        for(Dog t:list)
            System.out.println(t);
        System.out.println("按照health+love的方式排序：");
        Collections.sort(list,new HealthAndLoveCom());
        for(Dog t:list)
            System.out.println(t);
    }
}
